<?php

namespace App\Services\Fund;

use App\Services\ProjectValidate;

/**
 *
 * Class ValidateIntegralFreezeLog
 * @package App\Services\Fund
 */
class ValidateIntegralAccount extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
    }


    /**
     * @var array 用户模块的验证集合
     */
    public $rules = [
        'user_id' => 'integer|min:0',
        'obj_id' => 'integer|min:0',
        'create_ip' => ['ip'],
        'update_ip' => 'ip',
        'app_id' => 'integer|min:0',
        'integral' => 'integer|min:0',
        'opposite_id' => 'integer|min:0|different:user_id',
        'freeze_log_id' => ['integer', 'gt' => '0'],
        'user_ids' => 'between:1,256',
        'exchange' => 'in:Currency,Fund',
        'money' => 'integer|min:0',
        'currency_scale' => 'min:0|required_if:exchange,Currency',
//        'user_info' => ['regex:/^{.*}$/'],
//        'opposite_info' => ['regex:/^{.*}$/'],
        'type' => 'in:goods,certificate,order,integral_order',
        'obj_id' => ['integer', 'gt'=>'0'],
        'user_available_integral' => ['integer', 'egt'=>'0'],
        'order_max_integral_deduction' => ['integer', 'egt'=>'0'],
        'order_total_price' => ['number', 'gt'=>'0'],
        'order_currency_total_price' => ['number', 'egt'=>'0'],
        'fund_type' => ['in'=>'money,currency'],
        'reason' => ['min'=>5],
        'user_infos' => ['array', 'min'=>1]
    ];

    public $messages = [
       
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
      
    ];

   
}